import time

from LoginCart.Page.PageDetail import ProxyDetail
from LoginCart.Page.PageHome import ProxyHome
from LoginCart.Page.PageLogin import ProxyLogin
from LoginCart.utils import UtilsDriver, get_msg
class Test_login:
    def setup_class(self):
        self.proxy_home=ProxyHome()
        self.proxy_login=ProxyLogin()
        self.proxy_detail=ProxyDetail()
        self.proxy_home.go_login()
    def setup(self):
        UtilsDriver().get_driver().refresh()

    def teardown_class(self):
        UtilsDriver.quit_driver()

    def test_login_01(self):
        self.proxy_login.login_page("15837321720","123456","8888")
        time.sleep(5)
        self.proxy_home.go_index()
        time.sleep(2)
        self.proxy_home.go_search()
        time.sleep(2)
        self.proxy_detail.go_cart()
        time.sleep(2)
        message = get_msg()
        time.sleep(2)
        assert "添加成功" in message

